import React from 'react'
import { Navigate } from 'react-router-dom';

function Hoc_login(Com) {
    return () => {
        // 获取refreshToken
        let refreshToken = localStorage.getItem('refreshToken');
        if (refreshToken) {
            return <Com></Com>
        } else {
            return <Navigate to="/login"></Navigate>
        }
    }
}

export default Hoc_login